package com.sun.async.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sun.async.entity.Student;
import com.sun.async.entity.dto.StudentImportDTO;

import java.util.List;

/**
 * 学生服务接口
 */
public interface StudentService extends IService<Student>, AsyncExcelImportService.ImportService<StudentImportDTO> {

    /**
     * 处理导入的学生数据
     * @param studentImportDTOList 学生导入DTO列表
     * @return 处理结果，包含成功数和失败的记录
     */
    ImportProcessResult processImportData(List<StudentImportDTO> studentImportDTOList);

    /**
     * 导入处理结果类
     */
    class ImportProcessResult {
        private int successCount;
        private List<StudentImportDTO> failedRecords;

        public ImportProcessResult(int successCount, List<StudentImportDTO> failedRecords) {
            this.successCount = successCount;
            this.failedRecords = failedRecords;
        }

        public int getSuccessCount() {
            return successCount;
        }

        public List<StudentImportDTO> getFailedRecords() {
            return failedRecords;
        }
    }
}